<html><head><title>Music.pb</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<pre><font face="Courier New, Courier, mono"size="2"><font color="#3A3966">;
</font><font color="#3A3966">; ------------------------------------------------------------
</font><font color="#3A3966">;
</font><font color="#3A3966">;   PureBasic - Music example file
</font><font color="#3A3966">;
</font><font color="#3A3966">;    (c) Fantaisie Software
</font><font color="#3A3966">;
</font><font color="#3A3966">; ------------------------------------------------------------
</font><font color="#3A3966">;
</font>

<b><font color="#3A3966">If</font></b> <font color="#3A3966">InitSound</font>() = 0
<font color="#3A3966">  MessageRequester</font>(&quot;Error&quot;, &quot;Sound system not available.&quot;) : <b><font color="#3A3966">End</font></b>
<b><font color="#3A3966">EndIf</font></b>

FileName$ =<font color="#3A3966"> OpenFileRequester</font>(&quot;&quot;,&quot;&quot;,&quot;Music Modules (*.mod, *.xm, *.it)|*.mod;*.xm&quot;, 0)
<b><font color="#3A3966">If</font></b> FileName$
  <b><font color="#3A3966">If</font></b> <font color="#3A3966">LoadMusic</font>(0, FileName$)
<font color="#3A3966">    PlayMusic</font>(0)    
<font color="#3A3966">    MessageRequester</font>(&quot;PureBasic - Module player&quot;, &quot;Playing the music module...&quot;)
    
    <font color="#3A3966">; Now, perform a nice fading...
</font>    <font color="#3A3966">;
</font>    <b><font color="#3A3966">For</font></b> k=100 <b><font color="#3A3966">To</font></b> 0 <b><font color="#3A3966">Step</font></b> -1
<font color="#3A3966">      Delay</font>(20)
<font color="#3A3966">      MusicVolume</font>(0, k)
    <b><font color="#3A3966">Next</font></b>
    
  <b><font color="#3A3966">Else</font></b>
<font color="#3A3966">    MessageRequester</font>(&quot;Error&quot;, &quot;Can't load the music module or bad module format.&quot;)
  <b><font color="#3A3966">EndIf</font></b>
<b><font color="#3A3966">EndIf</font></b>
</font></pre>
</body></html>
